package com.zh.controller;

import com.zh.common.Result;
import com.zh.entity.Menu;
import com.zh.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zh
 * @since 2025-04-05
 */
@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;

    /**
     * 根据roleId获取菜单列表
     */
    @GetMapping("/list")
    public Result list(@RequestParam String roleId) {
        return menuService.list(roleId);
    }
}
